package com.sj.aopAnno;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

@Aspect
public class MyBook {

    //在方法上面使用注解完成增强配置
    @Before(value = "execution(* com.sj.aopAnno.Book.*(..))")
    public void before1() {
        System.out.println("前置增强........");
    }

    public void after1() {
        System.out.println("后置增强......");
    }

    //环绕通知
    public void around1(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        //方法之前
        System.out.println("around.方法之前.....");
        //执行被增强的方法
        proceedingJoinPoint.proceed();
        //方法之后
        System.out.println("around.方法之后......");
    }
}
